home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Jotto ][ 1.2 / source / Wipes ƒ / Four corner wipe.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  1.8 KB  |  56 lines  |  [TEXT/MMCC]

  1. #include "timing.h"
  2.  
  3. #define CorrectTime 1
  4. #define theWindowHeight (boundsRect.bottom-boundsRect.top)
  5. #define theWindowWidth (boundsRect.right-boundsRect.left)
  6.  
  7. pascal short FourCorner(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect);
  8.  
  9. /* Take 4 bars, two on each axis, and move them towards different corners.
  10.    This means lots of overlap copying, but the timing masks it and Quickdraw
  11.    may even take care of some of it. (?) */
  12.  
  13. pascal short FourCorner(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect)
  14. {
  15.     Rect        vsource1,hsource1,vsource2,hsource2;
  16.     short            vbar,hbar,cx,cy;
  17.     short            VBarGap, HBarGap;
  18.     
  19.     VBarGap=theWindowWidth/100;
  20.     HBarGap=theWindowHeight/100;
  21.  
  22.     vbar=VBarGap;
  23.     hbar=HBarGap;
  24.     cx = boundsRect.left + theWindowWidth/2;
  25.     cy = boundsRect.top + theWindowHeight/2;
  26.     vsource1.top=vsource2.top=boundsRect.top;
  27.     hsource2.left=hsource1.left=boundsRect.left;
  28.     vsource1.bottom=vsource2.bottom=boundsRect.bottom;
  29.     hsource1.right=hsource2.right=boundsRect.right;
  30.     while (vbar+boundsRect.left<cx+VBarGap)
  31.     {
  32.         StartTiming();
  33.         vsource1.left=cx-vbar;
  34.         vsource1.right=vsource1.left+VBarGap;
  35.         vsource2.right=cx+vbar;
  36.         vsource2.left=vsource2.right-VBarGap;
  37.         hsource1.top=cy-hbar;
  38.         hsource1.bottom=hsource1.top+HBarGap;
  39.         hsource2.bottom=cy+hbar;
  40.         hsource2.top=hsource2.bottom-HBarGap;
  41.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  42.             &vsource1, &vsource1, 0, 0L);
  43.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  44.             &hsource1, &hsource1, 0, 0L);
  45.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  46.             &vsource2, &vsource2, 0, 0L);
  47.         CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  48.             &hsource2, &hsource2, 0, 0L);
  49.         vbar+=VBarGap;
  50.         hbar+=HBarGap;
  51.         TimeCorrection(CorrectTime);
  52.     }
  53.     
  54.     return 0;
  55. }
  56.